// pages/goodsList/index.js
const app  = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    GoodList:null,
    introduction:[],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const {cid} = options
    this.setData({
      GoodList:app.globalData.BoardGameList[cid-1],//获取app中提前储存好的桌游数据
      introduction:app.globalData.BoardGameList[cid-1].introduction.split(" 　　     ")//桌游简介以该格式分割
    })
  },
  handlepreviewImage(e){
    const urls = this.data.GoodList.img//点击图片放大显示
    const index = e.currentTarget.dataset.idx
    console.log(index)
    wx.previewImage({
      urls: urls,
      current:urls[index]
    })
  },
})